Version:=3.10
ModuleName:=rp-pppoe
PPPName:=ppp-2.4.4

Object:=pppoe.tgz
ObjectDir:=$(ModuleName)-$(Version)/
ObjectSrcDir:=$(ObjectDir)/src/
ObjectSource:=$(ModuleName)-$(Version).tar.gz

PPPDir:=$(PPPName)
PPPSource:=$(PPPName).tar.gz

INSTALL_DIR:=`pwd`
INSTALL_PPP_DIR:=`pwd`/usr

.PHONY:all clean dist_clean 

all:$(Object)
	
$(Object):$(ObjectSource) $(PPPSource) chap-secrets pap-secrets  pppoe.conf
	rm -rf usr etc
	tar -xzf $(ObjectSource)
	cd $(ObjectSrcDir) && ./configure  && $(MAKE) 
	$(MAKE) -C $(ObjectSrcDir) install DESTDIR=$(INSTALL_DIR)
	tar -xzf $(PPPSource)
	cd $(PPPDir) && ./configure  && $(MAKE)
	$(MAKE) -C $(PPPDir) install DESTDIR=$(INSTALL_PPP_DIR)
	rm -rf usr/share usr/include && mkdir -p usr/bin && ln -s /bin/id usr/bin/id
	cp chap-secrets pap-secrets pppoe.conf etc/ppp/
	$(g_STRIP)
	tar -czf $(Object) usr etc

clean:
	rm -fr $(Object) usr etc

dist_clean: clean
	rm -fr $(ObjectDir) $(ObjectSource) $(PPPDir) $(PPPSource)

include ../Makefile.Res
